/*
 * @Description: 邀请好友   InviteGoodFriends
 * @version: 
 * @Company: 
 * @Author: ZhengZhuang
 * @Date: 2019-08-31 10:51:40
 * @LastAuthor   : zhengzhuang
 * @lastTime     : 2020-01-09 14:28:31
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:C20Driver/config/app_share.dart';
import 'package:C20Driver/widget/app_share.dart';

class InviteGoodFriends extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('邀请好友'),
        elevation: 0,
      ),
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color: Color(0xffBEEAB9),
        child: Stack(
          children: <Widget>[
            Image.asset(
              'assets/icon/inviteGoodFriendsBg.png',
              width: ScreenUtil().setWidth(750.0),
              height: ScreenUtil().setWidth(630.0),
              fit: BoxFit.contain,
            ),
            Positioned(
              top: ScreenUtil().setWidth(360),
              child: _myInvitation(context),
            ),
          ],
        ),
      ),
    );
  }

  // 我的邀请
  Widget _myInvitation(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(
        left: ScreenUtil().setWidth(32),
        right: ScreenUtil().setWidth(32),
      ),
      child: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              // height: ScreenUtil().setWidth(436),
              width: ScreenUtil().setWidth(686),
              padding: EdgeInsets.only(
                left: ScreenUtil().setWidth(36),
                right: ScreenUtil().setWidth(36),
              ),
              decoration: BoxDecoration(
                color: Color(0xffFFFFFF),
                borderRadius: BorderRadius.all(
                  Radius.circular(
                    ScreenUtil().setWidth(32),
                  ),
                ),
              ),
              child: Column(
                children: [
                  Image.asset(
                    'assets/icon/jiaruwomen.png',
                    width: ScreenUtil().setWidth(420),
                    height: ScreenUtil().setWidth(76),
                  ),
                  SizedBox(
                    height: ScreenUtil().setWidth(
                      ScreenUtil().setWidth(72),
                    ),
                  ),
                  Row(
                    children: [
                      Image.asset(
                        'assets/icon/icon_linear_wancheng.png',
                        width: ScreenUtil().setWidth(44),
                        height: ScreenUtil().setWidth(44),
                      ),
                      SizedBox(
                        width: ScreenUtil().setWidth(16),
                      ),
                      Text(
                        '工作自由，不受约束',
                        style: TextStyle(
                            color: Color(0xff697794),
                            fontSize: ScreenUtil().setWidth(30),
                            fontWeight: FontWeight.w500),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: ScreenUtil().setWidth(56),
                  ),
                  Row(
                    children: [
                      Image.asset(
                        'assets/icon/icon_linear_wancheng.png',
                        width: ScreenUtil().setWidth(44),
                        height: ScreenUtil().setWidth(44),
                      ),
                      SizedBox(
                        width: ScreenUtil().setWidth(16),
                      ),
                      Text(
                        '有车有工作，既顾家又赚钱',
                        style: TextStyle(
                            color: Color(0xff697794),
                            fontSize: ScreenUtil().setWidth(30),
                            fontWeight: FontWeight.w500),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: ScreenUtil().setWidth(56),
                  ),
                  Row(
                    children: [
                      Image.asset(
                        'assets/icon/icon_linear_wancheng.png',
                        width: ScreenUtil().setWidth(44),
                        height: ScreenUtil().setWidth(44),
                      ),
                      SizedBox(
                        width: ScreenUtil().setWidth(16),
                      ),
                      Text(
                        '平台订单多，收入有保障',
                        style: TextStyle(
                            color: Color(0xff697794),
                            fontSize: ScreenUtil().setWidth(30),
                            fontWeight: FontWeight.w500),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: ScreenUtil().setWidth(68),
                  ),
                ],
              ),
            ),
            SizedBox(
              height: ScreenUtil().setWidth(76),
            ),
            Container(
              width: ScreenUtil().setWidth(686.0),
              height: ScreenUtil().setWidth(100.0),
              decoration: BoxDecoration(
                boxShadow: <BoxShadow>[
                  BoxShadow(
                    color: Color(0x8845BC4A),
                    blurRadius: 5,
                    offset: Offset(2, 2),
                  )
                ],
                gradient: LinearGradient(
                  begin: Alignment.centerLeft,
                  end: Alignment.centerRight,
                  colors: [
                    Color(0xff3FB956),
                    Color(0xff65CA00),
                  ],
                ),
                borderRadius: BorderRadius.all(
                  Radius.circular(
                    ScreenUtil().setWidth(50),
                  ),
                ),
              ),
              child: MaterialButton(
                textColor: Colors.white,
                child: Text(
                  '邀请车主加入',
                  style: TextStyle(
                      fontSize: ScreenUtil().setSp(32),
                      fontWeight: FontWeight.w500),
                ),
                onPressed: () {
                  AppShare.share(context, AppShareCode().appShare);
                },
              ),
            ),
          ],
        ),
      ),
    );
  }

  // 邀请列表
  Widget _invitationList() {
    return Container(
      padding: EdgeInsets.only(
        left: ScreenUtil().setWidth(30.0),
        right: ScreenUtil().setWidth(30.0),
      ),
      margin: EdgeInsets.only(
        top: ScreenUtil().setWidth(15.0),
        bottom: ScreenUtil().setWidth(15.0),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          Row(
            children: <Widget>[
              Image.asset(
                'assets/icon/messageDefaultLogo.png',
                width: ScreenUtil().setWidth(80.0),
                height: ScreenUtil().setWidth(80.0),
              ),
              SizedBox(
                width: ScreenUtil().setWidth(20.0),
              ),
              Container(
                width: ScreenUtil().setWidth(300.0),
                child: Text(
                  'changechangechangechangechangechangechangechangechangechangechangechangechangechange',
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                    fontSize: ScreenUtil().setSp(28.0),
                    color: Colors.black38,
                  ),
                ),
              ),
            ],
          ),
          Text(
            '2019-08-28 16:22',
            style: TextStyle(
              fontSize: ScreenUtil().setSp(28.0),
              color: Colors.black54,
            ),
          ),
        ],
      ),
    );
  }
}
